<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>


<div id="red">红盒子</div>
<div id="blue">蓝盒子</div>
<script>
var red = document.getElementById("red");
alert(red.id);
var blue = document.getElementById("blue");
alert(blue.id);

</script>




</body>
</html>
